From d98a6f89a75111509321cfd310713c156a39fdfb Mon Sep 17 00:00:00 2001 From: robertl Date: Wed, 1 Jan 2003 17:03:20 +0000 Subject: [PATCH] Null terminate array, add space on closing tags in chain for Topografix. fixes from Alex and Ron. --- gpsbabel/gpx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index 4ae86bbf5..520f3c2ea 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -156,13 +156,14 @@ start_something_else(const char *el, const char **attrv) /* copy attributes */ avp = attrv; - new_tag->attributes = (char **)xcalloc(sizeof(char *),attr_count); + new_tag->attributes = (char **)xcalloc(sizeof(char *),attr_count+1); avcp = new_tag->attributes; while (*avp) { *avcp = xstrdup(*avp); avcp++; avp++; } + *avcp = NULL; if ( cur_tag ) { if ( cur_tag->child ) { @@ -597,7 +598,7 @@ fprint_xml_chain( xml_tag *tag ) char *tmp_ent; while ( tag ) { if ( !tag->cdata && !tag->child ) { - fprint_tag_and_attrs( "<", "/>", tag ); + fprint_tag_and_attrs( "<", " />", tag ); } else { fprint_tag_and_attrs( "<", ">", tag ); -- 2.30.2